#include "Bullet3Dynamics/ConstraintSolver/b3PgsJacobiSolver.h"
#ifdef __cplusplus
extern "C" {
#endif
b3PgsJacobiSolver* bullet_Newb3PgsJacobiSolver(bool usePgs){
	bool c_arg_usePgs=usePgs;
	b3PgsJacobiSolver* wrap_out = new b3PgsJacobiSolver(c_arg_usePgs);
	return wrap_out;
}

unsigned int bullet_b3PgsJacobiSolver_b3Rand2(b3PgsJacobiSolver* c_this){
	unsigned int c_out = c_this->b3Rand2();
	unsigned int wrap_out = (c_out);
	return wrap_out;
}

int bullet_b3PgsJacobiSolver_b3RandInt2(b3PgsJacobiSolver* c_this,int n){
	int c_arg_n=n;
	int c_out = c_this->b3RandInt2(c_arg_n);
	int wrap_out = (c_out);
	return wrap_out;
}

unsigned int bullet_b3PgsJacobiSolver_getRandSeed(b3PgsJacobiSolver* c_this){
	unsigned int c_out = c_this->getRandSeed();
	unsigned int wrap_out = (c_out);
	return wrap_out;
}

void bullet_b3PgsJacobiSolver_setRandSeed(b3PgsJacobiSolver* c_this,unsigned int seed){
	unsigned int c_arg_seed=seed;
	c_this->setRandSeed(c_arg_seed);
}

void bullet_b3PgsJacobiSolver_solveContacts(b3PgsJacobiSolver* c_this,int numBodies,b3RigidBodyData* bodies,b3InertiaData* inertias,int numContacts,b3Contact4* contacts,int numConstraints,b3TypedConstraint** constraints){
	int c_arg_numBodies=numBodies;
	b3RigidBodyData * c_arg_bodies=(b3RigidBodyData *)(void*)(bodies);
	b3InertiaData * c_arg_inertias=(b3InertiaData *)(void*)(inertias);
	int c_arg_numContacts=numContacts;
	b3Contact4 * c_arg_contacts=(b3Contact4 *)(void*)(contacts);
	int c_arg_numConstraints=numConstraints;
	b3TypedConstraint * * c_arg_constraints=(b3TypedConstraint * *)(void*)(constraints);
	c_this->solveContacts(c_arg_numBodies,c_arg_bodies,c_arg_inertias,c_arg_numContacts,c_arg_contacts,c_arg_numConstraints,c_arg_constraints);
}

float bullet_b3PgsJacobiSolver_solveGroup(b3PgsJacobiSolver* c_this,b3RigidBodyData* bodies,b3InertiaData* inertias,int numBodies,b3Contact4* manifoldPtr,int numManifolds,b3TypedConstraint** constraints,int numConstraints,b3ContactSolverInfo* infoGlobal){
	b3RigidBodyData * c_arg_bodies=(b3RigidBodyData *)(void*)(bodies);
	b3InertiaData * c_arg_inertias=(b3InertiaData *)(void*)(inertias);
	int c_arg_numBodies=numBodies;
	b3Contact4 * c_arg_manifoldPtr=(b3Contact4 *)(void*)(manifoldPtr);
	int c_arg_numManifolds=numManifolds;
	b3TypedConstraint * * c_arg_constraints=(b3TypedConstraint * *)(void*)(constraints);
	int c_arg_numConstraints=numConstraints;
	b3ContactSolverInfo const& c_arg_infoGlobal=(b3ContactSolverInfo const&)(*infoGlobal);
	b3Scalar c_out = c_this->solveGroup(c_arg_bodies,c_arg_inertias,c_arg_numBodies,c_arg_manifoldPtr,c_arg_numManifolds,c_arg_constraints,c_arg_numConstraints,c_arg_infoGlobal);
	float wrap_out = (c_out);
	return wrap_out;
}

#ifdef __cplusplus
}
#endif
